package com.yihubang.taobaokotlin.utils

/*
 * class title: 
 * Author by RenChunLin, Email 18957806320@163.com, Date on 2021/5/11.
 * PS: Not easy to write code, please indicate.
 */
class UrlUtils {
    companion object {
        fun createHomePagerUrl(categoryId: Int?, pageCode: Int): String {
            return "discovery/$categoryId/$pageCode"
        }

        fun getCoverPath(pict_url: String): String {
            return if (pict_url.startsWith("http") || pict_url.startsWith("http")) {
                pict_url
            } else {
                "https:$pict_url" + "_200x200.jpg"
            }
        }

        fun getCoverPath(pict_url: String, size: Int): String {
            return if (pict_url.startsWith("http") || pict_url.startsWith("http")) {
                pict_url
            } else {
                "https:$pict_url" + "_$size"+"x"+"$size.jpg"
            }
        }
    }
}